package com.jiexin.dao.dsh;

import com.jiexin.model.ErrorSyncChange;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: Jay_Liu
 * @Description: DSH 中 操作数据库
 * @Date: Created in 17:59 2018/9/7
 * @Modified By:
 */
public interface DSHChangeMapper {

    /**
     * get public primary key
     */
    Integer findPid();

    /**
     * find change Pid in whilch
     */
    Integer findNotTransferredChange();

    /**
     * update sync message for change
     * @param pid primary key
     * @param state sync state
     * @param message sync msg
     */
    void updateSyncMsgForChange(@Param("pid") Integer pid, @Param("state") Integer state, @Param("message") String message);

    /**
     * detect change with error sync state
     * @return pojo obj
     */
    ErrorSyncChange detectErrorSyncChange();

    /**
     * update mail state for change order
     * @param pid change primary ket
     * @param mailState mail state
     */
    void updateMailState(@Param("pid") Integer pid, @Param("mailState") Integer mailState);
}
